# !/usr/bin/env python
# -*- coding:utf-8 -*-
# @FileName : zsj.py
# @Time     : 2024/4/14 19:39
# @Author   : Robot-Zsj
"""
description:

i:
CA3385,CZ6678,SC6508,DU7523,HK4456,MK0987

o:
CA3385,CZ6678,DU7523,HK4456,MK0987,SC6508

"""
flights = input().split(',')

flights.sort(key=lambda x: (x[0:2], x[2:]))

print(",".join(flights))
